import React, { useState } from 'react'
import {Input} from 'antd'

const TodoInput=({placeholder,onSetQuery})=>{
    const [value,setvalue]=useState('')
    const onAdd=()=>{
        onSetQuery(value)
    }
    return(
    <>
        <section className='input-wrap'>
            <Input
                onPressEnter={onAdd}
                value={value}
                className="input"
                placeholder={placeholder}
                onChange={e=>setvalue(e.target.value)}
            />
        </section>
    </>
    )
}

export default TodoInput